package com.synjones.wschool.face.constant;

import com.synjones.wschool.common.util.CheckUtil;

/**
 * Created by lvhf on 2017-11-10.
 */
public enum ModuleSourceEnum {

    HOMEWORK(1, "作业"),
    EXAMBATCH(2, "成绩"),
    NOTICE(3, "公告(通知)"),
    STULEAVE(4, "请假"),
    CLASSSTAR(5, "班级之星"),
    CLASSPHOTO(6, "班级相册"),
    PAYMENTBILL(7, "缴费"),
    SOLICIT(8, "征订"),
    EXPANDACTIVITY(9, "拓展活动"),
    /**
     * 问卷调查
     */
    QUESTIONNAIRE(10, "问卷调查"),
    VOTE(11, "投票"),
    SECURITY(12, "安全通知"),
    HEALTHRECORD(13, "健康"),
    HOMEWORK_DETAIL(14, "作业点评"),
    SCHOOL_BANNER(15,"学校标语"),
    School_Elegent_Appearance(16,"校园风采"),
    FACE_INFO(17,"人脸"),
    Order_MEAL(18,"订餐");


    private Integer sourceId;
    private String sourceName;

    ModuleSourceEnum(Integer sourceId, String sourceName) {
        this.sourceId = sourceId;
        this.sourceName = sourceName;
    }

    public Integer getSourceId() {
        return sourceId;
    }


    public String getSourceName() {
        return sourceName;
    }

    public static String getModulSourceName(Integer sourceId) {
        ModuleSourceEnum[] values = ModuleSourceEnum.values();
        for (ModuleSourceEnum value : values) {
            if (CheckUtil.equals(value.getSourceId(), sourceId)) {
                return value.getSourceName();
            }
        }
        return "";
    }

    public static ModuleSourceEnum getEnum(Integer sourceTypeId){
        ModuleSourceEnum[] values = ModuleSourceEnum.values();
        for (ModuleSourceEnum value : values) {
            if (CheckUtil.equals(value.getSourceId(), sourceTypeId)) {
                return value;
            }
        }
        return null;
    }

}
